package com.gill.jwt.exception;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * @program: my-utils-repo
 * @description:
 * @author: Gill
 * @create: 2021-03-22 16:04
 **/
@Slf4j
@ControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(value =Exception.class)
    public String exceptionHandler(Exception e){
        log.error("未知异常！原因是:"+e);
        return e.getMessage();
    }
}
